package cn.tedu.kaifanlav1.customer.controller;

import cn.tedu.kaifanlav1.base.response.JsonResult;
import cn.tedu.kaifanlav1.customer.pojo.dto.CustomerParam;
import cn.tedu.kaifanlav1.customer.pojo.vo.CustomerVO;
import cn.tedu.kaifanlav1.customer.service.CustomerService;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@Slf4j
@RestController
@RequestMapping("/v1/customer/")
public class CustomerController {
    @Autowired
    CustomerService customerService;
//    @PostMapping("save")
//    public JsonResult saveCustomer(CustomerSaveParam customerSaveParam){
//        customerService.saveCustomer(customerSaveParam);
//        return JsonResult.ok();
//    }

    @GetMapping("selectPlaceorders")
    public JsonResult selectPlaceorders(CustomerParam customerParam){
        log.debug("查询用户:customerParam={}",customerParam);
        List<CustomerVO> list=customerService.selectPlaceorders(customerParam);
        return JsonResult.ok(list);
    }
}
